package com.smq.chatserver.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smq.chatserver.bean.User;
import com.smq.chatserver.mapper.UserMapper;
import com.smq.chatserver.services.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public boolean mobileExist(String mobile) {
        return null != userMapper.selectOne(new QueryWrapper<User>().eq("mobile", mobile));
    }
}
